<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="text" name="" id="num">
    <button id="btn">确定是否为闰年</button>
    <input type="text" name="" id="num1">
    <br>
    <input type="text" name="" id="num2">
    <button id="btn1">确定是否为闰年</button>
    <input type="text" name="" id="num3">
    <script>
        document.getElementById("btn").onclick = function() {
            var _num = Number(document.getElementById("num").value);
            var _num = (_num % 4 === 0 && _num % 100 !== 0 || _num % 400 === 0) ? "闰年" : "平年";
            document.getElementById("num1").value = _num;
        }
        document.getElementById("btn1").onclick = function() {
            var _num2 = Number(document.getElementById("num2").value);
            if (_num2 % 4 === 0 && _num2 % 100 != 0 || _num2 % 400 === 0) {
                document.getElementById("num3").value = "闰年";
            } else {
                document.getElementById("num3").value = "平年";
            }
        }
    </script>
</body>

</html>